package com.kevin.kafka.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author Kevin Liu
 * @date 2020/8/4 下午7:59
 */
@Slf4j
@Component
public class MessageConsumer {

    @KafkaListener(topics = "test")
    public void onMessage(String message){
        // 消费消息
        log.info("1接收到消息：" + message);
    }

    @KafkaListener(topics = "test")
    public void onGetMessage(String message){
        // 消费消息
        log.info("2接收到消息：" + message);
    }
}
